iT邦幫忙

0

DAY5:LLM是怎麼學會語言的?(下)

2025-10-14 13:18:14112 瀏覽
  • 分享至 

  • xImage
  •  

透過tokenizer.encode這個函數將文字轉換為對應的token編號。(Encode會自動加代表句子起始的符號(begin of text),不要它顯示的話就加add_specail_tokens=False。)
https://ithelp.ithome.com.tw/upload/images/20251014/20169372oUIPcx2ao9.png


同一個英文單字,大小寫不同,token亦不同。
https://ithelp.ithome.com.tw/upload/images/20251014/20169372jdSh4G2flc.png


單字前有無空格也被視為不同token。
https://ithelp.ithome.com.tw/upload/images/20251014/20169372mSj2kEA4RB.png


圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言